package com.hengxinguotong.zhihuichengjian.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @CopyRight 恒信国通信息科技
 * @Author WuLei
 * @Date 2019/1/16
 */

public class Construction implements Serializable {
    private String constructionId,//工地id
            constructionName,//工地名称
            orgId;//机构id
    private List<User> userList = new ArrayList<>();
    private boolean isChecked = false;

    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }

    public String getConstructionId() {
        return constructionId;
    }

    public void setConstructionId(String constructionId) {
        this.constructionId = constructionId;
    }

    public String getConstructionName() {
        return constructionName;
    }

    public void setConstructionName(String constructionName) {
        this.constructionName = constructionName;
    }

    public List<User> getUserList() {
        return userList;
    }

    public void setUserList(List<User> userList) {
        this.userList = userList;
    }

    public boolean isOneConstruction(Construction construction) {
        if (this.constructionId == null) {
            return false;
        }

        if (this.constructionId.equals(construction.getConstructionId())) {
            return true;
        }
        return false;
    }

    public boolean isInConstructions(List<Construction> constructions) {
        if (constructions == null) {
            return false;
        }
        if (constructions.size() == 0) {
            return false;
        }
        for (int i = 0; i < constructions.size(); i++) {
            if (this.isOneConstruction(constructions.get(i))) {
                return true;
            }
        }
        return false;
    }
}